<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var number=1;
    var sum=0;
    while (number <= 100){
        sum = sum + number;
        number++;
    }

    console.log('1到100的和为：'+sum);
</script>
<body>

</body>
</html>